# 请判断一个链表是否为回文链表。

# Definition for singly-linked list.
class ListNode:
    def __init__(self, val=0, next=None):
        self.val = val
        self.next = next
class Solution:
    def isPalindrome(self, head: ListNode) -> bool:
        if head == None:
            return True
        str_temp = ""
        while head!=None:
            str_temp = str_temp + str(head.val)
            head = head.next
        if str_temp[::1] == str_temp[::-1]:
            return True
        else:
            return False
        